<html lang="en">
<head>
    <title>Accessible Cross domain Demo - HTML5 Version </title>
    <style>
    body
    {
        background: #111;
        padding-bottom:10px;
        margin: 50px;
    }
    #c
    {
        width: 850px;
        margin: 0 auto;
        background: #EEE;
        border-top: 1px solid #fff;
        padding: 20px;
    }
    #results
    {
        width:800px;
        margin: 30px auto;
    }
    #code
    {
        background-color:#CCC;
        margin: 10px;
        padding-left:50px;
    }
    #cr
    {
        width:500px;
        margin:0 auto;
        background-color:#EEE;
        padding-left:125px;
    }
    </style>
</head>
<body>
    <div id="c">
    <h2 align="center">Accessible Cross domain Demo - HTML5 Version</h2>
         located at 112.65.241.74 is accessible by Cross Origin Request from any website.
    
    <h3 align="center">Demo</h3>
    <p>
        To make a request to this page from 112.65.241.74 and view the response click <a href="javascript:req()">here</a>.
    </p>
    <div id="status"></div>
    <div id="results"></div>
    <script>
    function req()
    {
        document.getElementById('results').innerHTML  = "";
        var cor;
        if (window.XDomainRequest)
        {
            cor = new XDomainRequest();
            if(cor)
            {
                cor.onprogress = function(){document.getElementById('status').innerHTML = "Fetching uCOR.php from 112.65.241.74:15010"};
                cor.onload = function()
                {
                    document.getElementById('status').innerHTML = "<b>Response from 112.65.241.74:15010</b>";
                    document.getElementById('results').innerHTML  = cor.responseText;
                }
            }
            else
            {
                document.getElementById('status').innerHTML = "<b>Browser does not support Cross Origin Request</b>";
            }
        }
        else
        {
            cor = new XMLHttpRequest();
            cor.onreadystatechange = function()
            {
                if (cor.readyState == 4)
                {
                    document.getElementById('status').innerHTML = "<b>Response from 112.65.241.74:15010</b>";    
                    document.getElementById('results').innerHTML  = cor.responseText;
                }
                else
                {
                    document.getElementById('status').innerHTML = "Fetching json data from 112.65.241.74:15010";
                }
            }
        }
        cor.open('GET', 'http://112.65.241.74:15010/Quotation/Quotation?s=TOP.IDX');
        cor.send();
    }
    </script>
    </div>
    
</body>
</html>

